/*
 * @Description: 元数据管理
 * @Author: Rfan
 * @Date: 2022-01-07 09:15:48
 * @LastEditTime: 2022-12-30 15:07:58
 */

import classNames from 'classnames/bind';
import { MetadataRouterTypeContext } from './contexts/MetadataRouterTypeContext';
import { MetadataContextProvider } from './contexts/MetaContext';
import NavSidebar from './components/NavSidebar';
import List from './components/List';
import PageLayout from '@/layout/PageLayout';
import { EnumMetadataRouteTypes } from '@/view/system/Metadata/dictionaries';
import styles from './styles/metadataMain.module.scss';

const cx = classNames.bind(styles);

interface ISystemMetadataProps {
  routerType?: EnumMetadataRouteTypes;
}

export const SystemMetadataPage = (props: ISystemMetadataProps) => {
  const { routerType = EnumMetadataRouteTypes.Normal } = props;

  return (
    <MetadataRouterTypeContext.Provider value={{ routerType }}>
      <MetadataContextProvider>
        <PageLayout className={cx('metadata-wrap')} sidebar={<NavSidebar />}>
          <List />
        </PageLayout>
      </MetadataContextProvider>
    </MetadataRouterTypeContext.Provider>
  );
};

const SystemMetadata = () => <SystemMetadataPage />;

export default SystemMetadata;
